package com.guigu.tms.commons.user.feign;

import com.guigu.tms.commons.user.entity.AddressBook;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "tms-user",path = "user/addressBook",contextId = "TUUA")
public interface AddressBookFeignClient {

    @GetMapping("getAddressBook")
    List<AddressBook> getAddressBook(@RequestParam String memberId);

    @GetMapping("getDefaultAddressBook")
    AddressBook getDefaultAddressBook(@RequestParam String userId);

    @PostMapping("addAddressBook")
    boolean addAddressBook(@RequestBody AddressBook addressBook);

    @PutMapping("updateAddressBook")
    boolean updateAddressBook(@RequestBody AddressBook addressBook);


    @DeleteMapping("deleteAddressBook/{id}")
    boolean deleteAddressBook(@PathVariable("id") String id);

    @PutMapping("setDefaultAddressBook")
    boolean setDefaultAddressBook(@RequestParam("userId") String userId,@RequestParam("id") String id);

    @GetMapping("getAddressBookById")
    AddressBook getAddressBookById(@RequestParam String id);
}
